﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Web.UI.DataVisualization.Charting;

namespace LSEntity
{
    /// <summary>
    /// 为只返回Id提供实体
    /// </summary>
    public class EntityId
    {
        /// <summary>
        /// Id
        /// </summary>
        public int Id { get; set; }
    }

    /// <summary>
    /// 提供KeyValue实体
    /// </summary>
    public class EntityIntInt
    {
        /// <summary>
        /// Key
        /// </summary>
        public int Key { get; set; }

        /// <summary>
        /// Value
        /// </summary>
        public int Value { get; set; }
    }

    /// <summary>
    /// 提供KeyValue实体
    /// </summary>
    public class EntityIntString
    {
        /// <summary>
        /// Key
        /// </summary>
        public int Key { get; set; }

        /// <summary>
        /// Value
        /// </summary>
        public string Value { get; set; }
    }

    /// <summary>
    /// 枚举排序
    /// </summary>
    [AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
    public class CurriculumEnumType : Attribute
    {
        public MemberExtendType MemberExtendType { get; set; }
    }

    public class ChartEntity<T>
    {
        public ChartEntity()
        {
            Width = 600;
            Height = 400;
            ChartType = SeriesChartType.Column;
            CacheMinutes = 3;
            CacheKey = DateTime.Now.ToString(CultureInfo.InvariantCulture);
        }

        public SeriesChartType ChartType { get; set; }
        public int Width { get; set; }
        public int Height { get; set; }
        public string Title { get; set; }
        public string XTitle { get; set; }
        public string YTitle { get; set; }
        public string CacheKey { get; set; }
        public int CacheMinutes { get; set; }
        public Func<IEnumerable<T>> GetData { get; set; }
    }

    public class ChartShowEntity<T1, T2, T3>
    {
        public T1 XField { get; set; }
        public T2 YField { get; set; }
        public T3 GroupField { get; set; }
    }
}
